package com.bsj.media.init.dto;

import lombok.Data;
import org.yeauty.pojo.Session;

import java.util.Objects;

@Data
public class SessionInfo {

    private Session session;

    private long time;

    public SessionInfo(Session sessionNow){
        this.session = sessionNow;
        this.time = System.currentTimeMillis();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SessionInfo that = (SessionInfo) o;
        return session.equals(that.session);
    }

    @Override
    public int hashCode() {
        return Objects.hash(session);
    }
}
